// Copyright 2022 jeff.li. and/or its affiliates.

#pragma once

#include <cstring>
#include <iostream>
#include <string>
#include <vector>

namespace tbir::runtime::StringUtil {

    extern std::string Format(const char *fmt, ...);

    extern bool Find(const std::string &source, const std::string &target);

    extern int Find(const char *source, size_t source_len, const char *target, size_t target_len);

    extern std::vector<std::string> Split(const std::string &input,
                                          const std::string &seps,
                                          bool preserve_all_tokens = true);

    extern std::string Concat(const std::vector<std::string> &inputs, const std::string &sep = "");

    extern std::string &Replace(std::string &input, const std::string &t, const std::string &r);

}  // namespace tbir::runtime::StringUtil
